<template>
  <div class="comment">
    <header class="site-header jumbotron">
      <div class="container">
        <div class="row">
          <div class="col-xs-12">
            <h1>请发表对善管的评论</h1>
          </div>
        </div>
      </div>
    </header>
    <div class="container">
    <Add :addComment="addComment"/>
    <List :comment="comment" :deleteComment="deleteComment"/>
    </div>
  </div>
</template>

<script>
import Add from './Add.vue'
import List from './List.vue'
export default {
  name: 'CommentsMain',
  data () {
    return {
      comment: [
        {
          name: 'Bigcow',
          content: '快'
        },
        {
          name: 'Cat',
          content: '恨'
        },
        {
          name: 'Bob',
          content: '稳'
        }
      ]
    }
  },
  methods: {
    addComment (comment) {
      this.comment.unshift(comment)
    },
    deleteComment (index) {
      this.comment.splice(index, 1)
    }
  },
  components: {
    Add,
    List
  }
}
</script>

<style scoped>
@import '../../../static/css/bootstrap.css';
.comment{
  text-align: left;
}
</style>
